package com.itboye.mengwu.app.ui.main;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;
import android.support.v4.view.ViewPager;

import com.itboye.core.object.BaseFragment;
import com.itboye.mengwu.R;
import com.itboye.mengwu.app.ui.main.GoodsDetailActivity.MyAdapter;
import com.itboye.mengwu.goodsdetail.snapscrollview.McoyProductContentPage;
import com.itboye.mengwu.goodsdetail.snapscrollview.McoyProductDetailInfoPage;
import com.itboye.mengwu.goodsdetail.snapscrollview.McoySnapPageLayout;
import com.itboye.mengwu.widget.PagerSlidingTabStrip;

public class GoodsFragment extends BaseFragment{

	@Override
	public int initView() {
		// TODO Auto-generated method stub
		return R.layout.mcoy_product_content_page;
	}

	@Override
	public void onMyActivityCreated() {
		// TODO Auto-generated method stub
		pager.setAdapter(new MyAdapter(getChildFragmentManager(),titles));
		tabs.setViewPager(pager);
	}
	PagerSlidingTabStrip tabs;
	ViewPager pager;
	private McoySnapPageLayout mcoySnapPageLayout ;
	
	private McoyProductContentPage bottomPage = null;
	private McoyProductDetailInfoPage topPage = null;

	ItemFragment bfrag;
	String[] titles = { "时政要闻", "休闲娱乐", "周末走呗" , "宠物世界" , "心灵微光"};
	public String pid;
	public String uid;
	

	public class MyAdapter extends FragmentStatePagerAdapter{
		String[] _titles;
		public MyAdapter(FragmentManager fm,String[] titles) {
			super(fm);
			_titles=titles;
		}
		
		@Override
		public CharSequence getPageTitle(int position) {
			return _titles[position];
		}
		
		@Override
		public int getCount() {
			return _titles.length;
		}

		@Override
		public Fragment getItem(int position) {
			ItemFragment bfrag2 = new ItemFragment(pid);
				return bfrag2;
		}
	}
}
